import * as grpc from "@grpc/grpc-js";

import {project_share_api} from "@/proto_gen_ts/proto/project_share_api";
import {project_doc_api} from "@/proto_gen_ts/proto/project_doc_api";
import {project_draw_api} from "@/proto_gen_ts/proto/project_draw_api";
import {project_sprit_api} from "@/proto_gen_ts/proto/project_sprit_api";
import {project_entry_api} from "@/proto_gen_ts/proto/project_entry_api";
import {project_issue_api} from "@/proto_gen_ts/proto/project_issue_api";
import {project_requirement_api} from "@/proto_gen_ts/proto/project_requirement_api";


export const shareClient = new project_share_api.ProjectShareApiClient(
    process.env.GRPC_ADDR!,
    grpc.credentials.createInsecure()
);

export const docClient = new project_doc_api.ProjectDocApiClient(
    process.env.GRPC_ADDR!,
    grpc.credentials.createInsecure()
);

export const drawClient = new project_draw_api.ProjectDrawApiClient(
    process.env.GRPC_ADDR!,
    grpc.credentials.createInsecure()
);

export const spritClient = new project_sprit_api.ProjectSpritApiClient(
    process.env.GRPC_ADDR!,
    grpc.credentials.createInsecure()
);

export const entryClient = new project_entry_api.ProjectEntryApiClient(
    process.env.GRPC_ADDR!,
    grpc.credentials.createInsecure()
);

export const issueClient = new project_issue_api.ProjectIssueApiClient(
    process.env.GRPC_ADDR!,
    grpc.credentials.createInsecure()
);

export const requirementClient = new project_requirement_api.ProjectRequirementApiClient(
    process.env.GRPC_ADDR!,
    grpc.credentials.createInsecure()
);